package cn.hchaojie.spring.day02.service;

import org.springframework.stereotype.Service;

@Service
public class CategoryService {
	
	public String findById(int id) {
		System.out.println("target对象里面的方法调用");
		
		try {
			Thread.sleep(1000);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		// -- 后置增强代码在这里
		return "java";
		// -- 返回后增强
	}
	
	public String findLike(String name) {
		System.out.println("target对象里面的方法调用");
		
		if (true) {
			throw new RuntimeException("这是我故意造的异常。。。");
		}

		return "spring";
	}
}
